package com.awtj;

import javax.swing.*;
import java.awt.*;

public class Rose extends JPanel {
    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        int x, y;
        for (double i = 0; i <= 2 * Math.PI; i += Math.PI / 180) {
            x = (int) (Math.cos(i) * Math.cos(4 * i) * 100 + 200);
            y = (int) (Math.sin(i) * Math.cos(4 * i) * 100 + 200);
            g.fillOval(x, y, 2, 2);
        }
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setSize(400, 400);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new Rose());
        frame.setVisible(true);
    }
}

